Method and apparatus for coding video and method and apparatus for decoding video, using intra prediction

ABSTRACT

A video decoding method involving intra prediction includes: parsing a most probable mode (MPM) flag of a block while parsing symbols of the block of an encoded video from a received bitstream; determining whether a predetermined number of a plurality of candidate intra prediction modes are used to predict an intra prediction mode of the block based on the MPM flag; when it is determined that the plurality of candidate intra prediction modes are used based on the MPM flag, determining the plurality of candidate intra prediction modes based on intra prediction modes of a left block and an upper block that are adjacent to the block while restoring the intra prediction mode of the block by using the parsed symbols.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a Continuation of U.S. patent application Ser. No.14/130,150, which is a National Stage application under 35 U.S.C. §371of PCT/KR2012/005088, filed on Jun. 27, 2012, which claims priority fromU.S. Provisional Application No. 61/501,974, filed on Jun. 28, 2011, allthe disclosures of which are incorporated herein in their entireties byreference.

BACKGROUND

1. Field

Apparatuses and methods consistent with exemplary embodiments relate toencoding and decoding a video by using intra prediction.

2. Description of the Related Art

As hardware for reproducing and storing higher resolution or higherquality video content is being developed and supplied, a need for avideo codec for effectively encoding or decoding the higher resolutionor higher quality video content is increasing. In a related art videocodec, a video is encoded according to a limited encoding method basedon a macroblock having a predetermined size.

Image data of a spatial domain is converted into coefficients of afrequency domain by using frequency conversion. A video codec divides animage into blocks of predetermined sizes for rapidly performing thefrequency conversion, and performs discrete cosine transformation (DCT)on every block to encode the frequency coefficient of the block unit. Itis easier to compress the coefficients of the frequency domain than theimage data of the spatial domain. In particular, since image pixelvalues in the spatial domain may be represented as predicted errorsthrough inter-prediction or intra-prediction of the video codec, a largeamount of data may be converted to 0 when performing the frequencyconversion on the predicted errors. The video codec reduces a dataamount by substituting data that is continuously and repeatedlygenerated with small-sized data.

SUMMARY

Aspects of one or more exemplary embodiments provide a method and anapparatus for encoding a video, in which predicative encoding isperformed in an intra prediction mode, by using intra prediction, and amethod and an apparatus for decoding a video.

According to an aspect of an exemplary embodiment, there is provided avideo decoding method involving intra prediction, the method including:parsing a most probable mode (MPM) flag of a block while parsing symbolsof the block of an encoded video from a received bitstream; determiningwhether a predetermined number of a plurality of candidate intraprediction modes are used to predict an intra prediction mode of theblock based on the MPM flag; when it is determined that the plurality ofcandidate intra prediction modes are used based on the MPM flag,determining the plurality of candidate intra prediction modes based onintra prediction modes of a left block and an upper block that areadjacent to the block while restoring the intra prediction mode of theblock by using the parsed symbols; predicting the intra prediction modeof the block by using the determined plurality of candidate intraprediction modes; and performing the intra prediction on the block byusing the predicted intra prediction mode.

The determining of the plurality of candidate intra prediction modes mayinclude determining default intra prediction modes as the plurality ofcandidate intra prediction modes based on the intra prediction mode ofthe left block, when the intra prediction modes of the left block andthe upper block are the same as each other.

The determining of the plurality of candidate intra prediction modes mayinclude determining the plurality of candidate intra prediction modes byusing the intra prediction mode of the left block, when the intraprediction modes of the left block and the upper block are the same aseach other.

The determining of the plurality of candidate intra prediction modes mayinclude determining two candidate intra prediction modes from among theplurality of candidate intra prediction modes as the intra predictionmodes of the left block and the upper block, when the intra predictionmodes of the left block and the upper block are different from eachother.

The parsing may include parsing index information representing one ofthe plurality of candidate intra prediction modes from the bitstream,when it is determined that the plurality of intra prediction modes areused to determine the intra prediction mode of the block based on theMPM flag, and the predicting of the intra prediction mode of the blockmay include determining one from among the plurality of candidate intraprediction modes, which is selected based on the index information, asthe intra prediction mode of the block.

The parsing may include parsing current intra mode information of theblock from the bitstream, when it is determined that the intraprediction mode of the block is different from the intra predictionmodes of the left block and the upper block based on the MPM flag, andthe predicting of the intra prediction mode of the block may includeinterpreting a relationship between the intra prediction mode of theblock and the plurality of candidate intra prediction modes from theparsed current intra mode information of the block, and determining theintra prediction mode of the block based on a result of theinterpretation.

According to another aspect of an exemplary embodiment, there isprovided a video encoding method involving intra prediction, the methodincluding: comparing an intra prediction mode of a block, which isdetermined through intra prediction on the block in a video, with intraprediction modes of a left block and an upper block that are adjacent tothe block; encoding a most probable mode (MPM) flag representing whetherthere is an intra prediction mode that is the same as the intraprediction mode of the block between the intra prediction modes of theleft block and the upper block; if there is an intra prediction modethat is the same as the intra prediction mode of the block between theintra prediction modes of the left block and the upper block,determining a predetermined number of a plurality of candidate intraprediction modes regardless of whether the intra prediction modes of theleft block and the upper block are the same as or different from eachother; and encoding current intra mode information of the block, whichis determined based on the plurality of candidate intra predictionmodes.

The determining of the plurality of candidate intra prediction modes mayinclude determining default intra prediction modes as the plurality ofcandidate intra prediction modes based on the intra prediction mode ofthe left block, when the intra prediction modes of the left block andthe upper block are the same as each other.

The determining of the plurality of candidate intra prediction modes mayinclude determining the plurality of candidate intra prediction modes byusing the intra prediction mode of the left block, when the intraprediction modes of the left block and the upper block are the same aseach other.

The determining of the plurality of candidate intra prediction modes mayinclude determining two candidate intra prediction modes from among theplurality of candidate intra prediction modes as the intra predictionmodes of the left block and the upper block, when the intra predictionmodes of the left block and the upper block are different from eachother.

The encoding of the current intra mode information of the block mayinclude encoding index information representing a candidate intraprediction mode corresponding to the intra prediction mode of the blockfrom among the plurality of candidate intra prediction modes, in a casewhere there is an intra prediction mode that is the same as the intraprediction mode of the block between the intra prediction modes of theleft block and the upper block.

The encoding of the current intra mode information of the block mayinclude: determining the current intra mode information of the block,which represents a relationship between the intra prediction mode of theblock and the candidate intra prediction modes, when the intraprediction mode of the block is different from the intra predictionmodes of the left block and the upper block; and encoding the currentintra mode information of the block.

According to another aspect of another exemplary embodiment, there isprovided a video decoding apparatus involving intra prediction, theapparatus including: a parsing unit configured to parse a most probablemode (MPM) flag of a block while parsing symbols of the block of anencoded video from a received bitstream, and determine whether apredetermined number of a plurality of intra prediction modes are usedto determine the intra prediction mode of the block based on the MPMflag; and an intra prediction unit configured to, when it is determinedthat the plurality of candidate intra prediction modes are used based onthe MPM flag, determine the plurality of candidate intra predictionmodes based on intra prediction modes of a left block and an upper blockthat are adjacent to the block while restoring the intra prediction modeof the block by using the parsed symbols, predict the intra predictionmode of the block by using the determined plurality of candidate intraprediction modes, and perform intra prediction on the block by using thepredicted intra prediction mode.

According to another aspect of still another exemplary embodiment, thereis provided a video encoding apparatus including: an intra predictionunit configured to perform intra prediction with respect to a block forencoding a video; and a symbol encoding unit configured to encodesymbols generated through the intra prediction of the block, wherein thesymbol encoding unit compares an intra prediction mode of the block,which is determined through intra prediction on the block in the video,with intra prediction modes of a left block and an upper block that areadjacent to the block, and encodes a most probable mode (MPM) flagrepresenting whether there is an intra prediction mode that is the sameas the intra prediction mode of the block between the intra predictionmodes of the left block and the upper block, and the symbol encodingunit, if there is an intra prediction mode that is the same as the intraprediction mode of the block between the intra prediction modes of theleft block and the upper block, determines a predetermined number of aplurality of candidate intra prediction modes regardless of whether theintra prediction modes of the left block and the upper block are thesame as or different from each other, and encodes current intra modeinformation of the block, which is determined based on the plurality ofcandidate intra prediction modes

According to another aspect of still another exemplary embodiment, thereis provided a computer readable recording medium having recorded thereona program for executing the above described method.

The determining of the default intra prediction modes may includedetermining at least one of an intra prediction mode that has a higherprobability of being generated, an intra prediction mode having animproved prediction function, or a mode similar to the left intraprediction mode as the default intra prediction modes.

The determining of the plurality of candidate intra prediction modes mayinclude determining an intra prediction mode of at least one ofneighboring blocks except for the left and upper blocks, which isdifferent from the intra prediction modes of the left and upper blocks,as a candidate intra prediction mode.

BRIEF DESCRIPTION OF THE DRAWINGS

The above and other features will become more apparent by describing indetail exemplary embodiments thereof with reference to the attacheddrawings in which:

FIG. 1 is a block diagram of an apparatus for encoding a video accordingto an exemplary embodiment;

FIG. 2 is a block diagram of an apparatus for decoding a video accordingto an exemplary embodiment;

FIG. 3 is a diagram showing neighboring prediction units referred to forpredicting an intra prediction mode according to an exemplaryembodiment;

FIG. 4 is a diagram showing prediction units referred to for predictingan intra prediction mode in video coding based on a decoding unitaccording to a tree structure according to an exemplary embodiment;

FIG. 5 is a flowchart illustrating a video encoding method according toan exemplary embodiment;

FIG. 6 is a flowchart illustrating a video decoding method according toan exemplary embodiment;

FIG. 7 is a block diagram of a video encoding apparatus based on codingunits of a tree structure according to an exemplary embodiment;

FIG. 8 is a block diagram of a video decoding apparatus based on codingunits of a tree structure according to an exemplary embodiment;

FIG. 9 is a diagram for describing a concept of coding units accordingto an exemplary embodiment;

FIG. 10 is a block diagram of an image encoder based on coding unitsaccording to an exemplary embodiment;

FIG. 11 is a block diagram of an image decoder based on coding unitsaccording to an exemplary embodiment;

FIG. 12 is a diagram illustrating coding units and partitions accordingto depths, according to an exemplary embodiment;

FIG. 13 is a diagram for describing a relationship between a coding unitand transformation units according to an exemplary embodiment;

FIG. 14 is a diagram for describing encoding information of coding unitscorresponding to a coded depth according to an exemplary embodiment;

FIG. 15 is a diagram of coding units according to depths according to anexemplary embodiment;

FIGS. 16 through 18 are diagrams for describing a relationship betweencoding units, prediction units, and transformation units according to anexemplary embodiment; and

FIG. 19 is a diagram for describing a relationship between a codingunit, a prediction unit or a partition, and a transformation unitaccording to encoding mode information of Table 1.

DETAILED DESCRIPTION

Hereinafter, exemplary embodiments will be described more fully withreference to the accompanying drawings, in which like reference numeralsrefer to like elements throughout.

A video encoding method and a video decoding method based on an intraprediction mode prediction method will be described with reference toFIGS. 1 through 6 according to an exemplary embodiment. In addition,exemplary embodiments where a prediction scheme of the intra predictionmode is used in the video encoding method and the video decoding methodbased on coding units of a tree structure will be described withreference to FIGS. 7 through 19. Hereinafter, the term ‘image’ may referto a still image of a video, or may refer to a moving picture, that is,the video itself.

First, a video encoding method and a video decoding method based on theintra prediction mode prediction method according to an exemplaryembodiment will be described with reference to FIGS. 1 through 6.

FIG. 1 is a block diagram of a video encoding apparatus 10 according toan exemplary embodiment.

The video encoding apparatus 10 may encode video data of a spatialdomain through intra prediction and/or inter prediction, transformation,quantization, and symbol encoding. Hereinafter, operations for encodingsymbols that are generated by intra-prediction of the video encodingapparatus 10 will be described.

The video encoding apparatus 10 includes an intra prediction unit 12 anda symbol encoding unit 14.

The video encoding apparatus 10 of the present embodiment divides imagedata of a video into a plurality of data units, and may perform encodingon each data unit. The data unit may be formed as a square, a rectangle,or an arbitrary geometrical shape. Exemplary embodiments are not limitedto the data unit of a predetermined size. For convenience ofdescription, a video encoding method with respect to a ‘block’ that is akind of data unit will be described. However, the video encoding methodaccording to exemplary embodiments is not limited to the video encodingmethod with respect to the ‘block’, but may be applied to various dataunits.

The intra prediction unit 12 performs an intra prediction with respectto blocks of the video. The intra prediction unit 12 may determine anintra prediction mode that represents a direction where referenceinformation is located among neighboring information, for performing theintra prediction with respect to each of the blocks. The intraprediction unit 12 may perform the intra prediction with respect to thecurrent block according to a kind of intra prediction mode.

According to the intra prediction method of the present embodiment, theintra prediction mode of the current block (hereinafter, the currentintra prediction mode) may be predicted with reference to intraprediction modes of neighboring blocks. The symbol encoding unit 14 mayencode prediction information of the current intra prediction mode.

The symbol encoding unit 12 may compare the current intra predictionmode that is determined through the intra prediction of the currentblock with intra prediction modes of a left block and an upper blockfrom among the neighboring blocks adjacent to the current block, topredict the current intra prediction mode.

For example, the symbol encoding unit 14 may encode a most probable mode(MPM) flag representing whether there is an intra prediction mode thatis substantially the same as the current intra prediction mode fromamong the intra prediction modes of the left block and the upper block.

For example, if there is a mode that is the same as the current intraprediction mode between the intra prediction modes of the left block andthe upper block, the symbol encoding unit 14 may determine a pluralityof candidate intra prediction modes, the number of which is fixed whenthe intra prediction modes of the left block and the upper block are thesame as or different from each other. For example, the symbol encodingunit 14 may encode the current intra mode information under anassumption that there are three candidate intra prediction modes for thecurrent intra prediction mode, if there is a mode that is the same asthe current intra prediction mode between the intra prediction modes ofthe left block and the upper block. As another example, the currentintra mode information may be encoded under an assumption that there aretwo candidate intra prediction modes. The symbol encoding unit 14determines the current intra mode information of the current block basedon a plurality of candidate intra prediction modes, and encodes thecurrent intra mode information. The current intra mode information maybe index information representing one of the candidate intra predictionmodes, or index information representing the current intra mode.

The symbol encoding unit 14 may determine two or more candidate intraprediction modes that are used to predict the current intra predictionmode without considering whether the left intra prediction mode and theupper intra prediction mode are the same, when there is a mode that isthe same as the current intra prediction mode between the intraprediction modes of the left block and the upper block. For example, aplurality of candidate intra prediction modes, for example, two, three,or four candidate intra prediction modes, may be used to determine thecurrent intra prediction mode.

In addition, symbols are encoded under an assumption that there are afixed number of candidate intra prediction modes without considering acase where the number of the candidate intra prediction modes ischanged, and thus, the encoding operation of the intra mode may besimplified.

The symbol encoding unit 14 of the present embodiment may determinedefault intra prediction modes as a plurality of candidate intraprediction modes based on the intra prediction mode of the left block,if the intra prediction modes of the left block and the upper block arethe same as each other. According to another exemplary embodiment, thesymbol encoding unit 14 may determine a plurality of candidate intraprediction modes by modifying the intra prediction mode of the leftblock, if the intra prediction modes of the left block and the upperblock are the same as each other.

According to an exemplary embodiment, the symbol encoding unit 14 maydetermine two candidate intra prediction modes from among the pluralityof candidate intra prediction modes as the intra prediction modes of theleft block and the upper block, respectively, if the intra predictionmodes of the left block and the upper block are different from eachother.

According to an exemplary embodiment, the symbol encoding unit 14 mayencode information representing the candidate intra prediction modecorresponding to the current intra prediction mode, based on theplurality of candidate intra prediction modes.

According to an exemplary embodiment, the symbol encoding unit 14 mayencode index information representing the candidate intra predictionmode corresponding to the current intra prediction mode from among theplurality of candidate intra prediction modes, if there is the intraprediction mode that is the same as the intra prediction mode of thecurrent block between the intra prediction modes of the left block andthe upper block.

According to an exemplary embodiment, the symbol encoding unit 14 mayencode the current intra prediction mode information representing theintra prediction mode of the current block, if the intra prediction modeof the current block is different from those of the left block and theupper block.

According to another embodiment, the symbol encoding unit 14 may encodethe current intra mode information representing a relationship betweenthe candidate intra prediction modes and the current intra predictionmode so that the current intra prediction mode may be inferred from theplurality of candidate intra prediction modes, even when the intraprediction mode of the current block is different from the intraprediction modes of the left block and the upper block. In this case,even if the intra prediction mode of the current block is different fromthe intra prediction modes of the left block and the upper block, thesymbol encoding unit 14 determines the plurality of candidate intraprediction modes and encodes the current intra mode information based onthe plurality of candidate intra prediction modes.

Therefore, the symbol encoding unit 14 may output current intra modeinformation, subsequent to the MPM flag that is encoded for the currentblock.

Also, the symbol encoding unit 14 may encode information representingthe number of candidate intra prediction modes.

The symbol encoding unit 14 of the present embodiment may encode aquantized transformation coefficient of residual data that is generatedas a result of the intra prediction of the current block.

Therefore, the video encoding apparatus 10 of the present embodiment mayencode and output the symbols generated as a result of the intraprediction of the blocks of the video.

The video encoding apparatus 10 of the present embodiment may include acentral processor (not shown) for overall controlling the intraprediction unit 12 and the symbol encoding unit 14. Alternatively, theintra prediction unit 12 and the symbol encoding unit 14 arerespectively driven by exclusive processors (not shown), and the videoencoding apparatus 10 may be driven overall by systematic operations ofthe processors (not shown). Alternatively, the intra prediction unit 12and the symbol encoding unit 14 may be controlled by an externalprocessor (not shown) of the video encoding apparatus 10 according to anexemplary embodiment.

According to the present embodiment, the video encoding apparatus 10 mayinclude one or more data storage units (not shown) for storinginput/output data of the intra prediction unit 12 and the symbolencoding unit 14. The video encoding apparatus 10 may include a memorycontroller (not shown) for controlling data input/output of the datastorage unit (not shown).

According to the present embodiment, the video encoding apparatus 10 mayperform the video encoding operation including the prediction andtransformation by operating in connection with a video encodingprocessor mounted therein or an external video encoding processor tooutput the video encoding result. The internal video encoding processorin the video encoding apparatus 10 according to an exemplary embodimentmay include a video encoding processing module included in the videoencoding apparatus 10 or a central calculation device or a graphiccalculation device to perform a basic video encoding operation, as wellas a separate processor.

FIG. 2 is a block diagram of a video decoding apparatus 20 according toan exemplary embodiment.

The video decoding apparatus 20 may decode video data that is encoded bythe video encoding apparatus 10 through parsing, symbol decoding,inverse quantization, inverse transformation, or intra prediction/motioncompensation to restore video data that is substantially the same orsimilar to the original video data of the spatial domain. Hereinafter,processes of parsing symbols for the intra prediction from bit streamsand restoring the intra prediction mode from the parsed symbols will bedescribed.

The video decoding apparatus 20 of the present embodiment includes aparsing unit 22 and an intra prediction unit 24.

The video decoding apparatus 20 may receive a bit stream in whichencoded data of the video is written. The parsing unit 22 may parsessymbols from the bit stream.

The parsing unit 22 of the present embodiment may parse symbols that aregenerated as an intra prediction result with respect to blocks of thevideo from the bit stream.

The parsing unit 22 may parse the MPM flags of the blocks during parsingthe symbols of the video blocks from the received bit stream.

The parsing unit 22 of the present embodiment may determine whether afixed number of plurality of candidate intra prediction modes are usedto predict an intra prediction mode of a current block based on theparsed MPM flag of the current block.

In a case where the candidate intra prediction modes are used, since aconstant number of candidate intra prediction modes are assumed, theparsing unit 22 may parse the current intra mode information withoutconsidering a case where the number of the candidate intra predictionmodes is changed after parsing the MPM flag. After parsing the symbolsrelating to the intra prediction of the current block by the parsingunit 22, the intra prediction unit 24 may restore data for the intraprediction, for example, the intra prediction mode of the current block,by using the parsed symbols. The quantized transformation coefficient ofthe residual data generated as a result of the intra prediction of thecurrent block may be restored from the parsed data by the parsing unit22.

In a case where it is determined that the plurality of candidate intraprediction modes are used based on the MPM flag, the intra predictionunit 24 of the present embodiment may determine the plurality ofcandidate intra prediction modes, the number of which is fixed, forpredicting the intra prediction mode of the current block whilerestoring the current intra prediction mode of the current block byusing the parsed symbols of the blocks. For example, the intraprediction unit 24 may predict the current intra prediction mode byconstantly using three candidate intra prediction modes. As anotherexample, the intra prediction unit 24 may assume that two candidateintra prediction modes are constantly used.

The intra prediction unit 24 of the present embodiment may determine theplurality of candidate intra prediction modes based on intra predictionmodes of a left block and an upper block that are adjacent to thecurrent block.

The intra prediction unit 24 of the present embodiment may restore theintra prediction mode from the parsed symbols of the current block. Theintra prediction unit 24 may perform the intra prediction on the currentblock by using the intra prediction mode.

The video decoding apparatus 20 may restore the residual data of thespatial domain from the quantized transformation coefficient of theresidual data through the inverse quantization and the inversetransformation, in a case where the quantized transformation coefficientof the residual data of the current block is parsed from the bit stream.The intra prediction unit 24 may perform the intra prediction withrespect to the residual data of the spatial domain of the current blockby using the intra prediction mode.

The intra prediction mode 24 according to the present embodiment maydetermine a plurality of candidate intra prediction modes to predict thecurrent intra prediction mode when the intra prediction modes of theleft block and the upper block of the current block are the same as ordifferent from each other. Therefore, the intra prediction mode 24 maydetermine the plurality of intra prediction modes without consideringwhether the intra prediction modes of the left block and the upper blockare the same as each other.

If the intra prediction modes of the left block and the upper block arethe same as each other, the intra prediction unit 24 of the presentembodiment may determine default intra prediction modes as the pluralityof candidate intra prediction modes based on the intra prediction modeof the left block. For example, when the intra prediction mode of theleft block is a predetermined intra prediction mode, the plurality ofcandidate intra prediction modes may be determined to include aplurality of default intra prediction modes.

As another example, if the intra prediction modes of the left block andthe upper block are the same as each other, the intra prediction mode 24may determine a plurality of candidate intra prediction modes by usingthe intra prediction mode of the left block. For example, when the intraprediction mode of the left block is a predetermined intra predictionmode, the plurality of candidate intra prediction modes may bedetermined to include values borrowed or modified from the intraprediction mode of the left block.

If the intra prediction modes of the left block and the upper block aredifferent from each other, the intra prediction mode 24 of the presentembodiment may adopt the intra prediction modes of the left block andthe upper block as two candidate intra prediction modes from among theplurality of candidate intra prediction modes.

The parsing unit 22 of the present embodiment may parse current intramode information subsequent to the MPM flag when parsing the symbols ofthe current block from the bit stream.

The parsing unit 22 of the present embodiment may parse indexinformation representing one candidate intra prediction mode from amongthe plurality of candidate intra prediction modes as the current intramode information, if it is determined that the plurality of candidateintra prediction modes are used to determine the current intraprediction mode based on the parsed MPM flag. The intra prediction unit24 may determine one candidate prediction mode selected based on theindex information from among the plurality of candidate intra predictionmodes as the current intra prediction mode.

The parsing unit 22 of the present embodiment may parse an index of theintra prediction mode exactly representing the intra predictiondirection of the current block as the current intra mode information, ina case where the intra prediction mode of the current block is differentfrom the intra prediction modes of the left block and the upper blockbased on the MPM flag. Therefore, the intra prediction unit 24 maydetermine the intra mode of the current block directly from the currentintra mode information.

As another example, the intra prediction unit 24 may determine the intraprediction mode of the block based on the current intra mode informationof the current block and the plurality of candidate intra predictionmodes. For example, a relationship between the candidate intraprediction modes and the current intra prediction mode may beinterpreted from the current intra mode information. In this case, theintra prediction unit 24 determines the plurality of candidate intraprediction modes even when the current intra prediction mode isdifferent from the intra prediction modes of the left block and a rightblock, and may determine the current intra prediction mode by inferringfrom the candidate intra prediction modes by using the current intramode information.

The scalable video decoding apparatus 20 of the present embodiment mayinclude a central processor (not shown) that controls the parsing unit22 and the intra prediction unit 24. Alternatively, the parsing unit 22and the intra prediction unit 24 are respectively driven by exclusiveprocessors (not shown), and the video decoding apparatus 20 may bedriven overall by systematical operations of the processors (not shown).Alternatively, the parsing unit 22 and the intra prediction unit 24 maybe controlled by an external processor (not shown) of the video decodingapparatus 20 according to the present embodiment.

According to the present embodiment, the video decoding apparatus 20 mayinclude one or more data storage units (not shown) for storinginput/output data of the parsing unit 22 and the intra prediction unit24. The video decoding apparatus 20 may include a memory controller (notshown) for controlling data input/output of the data storage unit (notshown).

According to the present embodiment, the video decoding apparatus 20 mayperform the video decoding operation including the inversetransformation by operating in connection with a video decodingprocessor mounted therein or an external video decoding processor torestore the video through the video decoding. The internal videodecoding processor in the video decoding apparatus 20 according to anexemplary embodiment may include a video decoding processing moduleincluded in the video decoding apparatus 20, or a central calculationdevice or a graphic calculation device to perform a basic video decodingoperation, as well as a separate processor.

According to the video encoding apparatus 10 and the video decodingapparatus 20 described with reference to FIGS. 1 and 2, while restoringthe intra prediction mode by parsing the symbols of the blocks from thebit stream, the symbols of the blocks including the MPM flag and thecurrent intra mode information are parsed, and then, the current intraprediction mode may be restored based on the MPM flag and the currentintra mode information among the parsed symbols. Therefore, a process ofparsing the symbols of the blocks from the bit stream and a process ofrestoring the intra prediction mode from the parsed symbols may beseparate from each other. When the parsing and restoring processes ofthe symbols are not separate, the symbols need to be restored whileparsing the symbols and the symbols are parsed again, that is, theparsing and restoring operations of the block symbols are repeated,thereby degrading efficiency of the decoding process. Therefore,according to the video encoding apparatus 10 and the video decodingapparatus 20 of the present embodiment, the parsing and restoringprocesses of the intra prediction mode are separate during the parsingof the symbols, and accordingly, efficiency of the decoding process maybe improved.

If the number of candidate intra prediction modes varies depending oncases even when there are a plurality of candidate intra predictionmodes, the parsing process becomes complicated because variablesaccording to the number of the candidate intra prediction modes need tobe considered when parsing the intra related information. However,according to the video decoding apparatus 20 of the present embodiment,a constant number of candidate intra prediction modes are assumed whenpredicting the intra prediction mode by using the candidate intraprediction modes, and thus, the MPM flag and the current intra modeinformation may be parsed without considering a case where the number ofcandidate intra prediction modes is changed during the symbol parsingprocess, thereby reducing the complexity of the parsing operation.

Hereinafter, exemplary embodiments for predicting the intra predictionmodes that may be realized in the video encoding apparatus 10 and thevideo decoding apparatus 20 will be described.

FIG. 3 is a diagram showing blocks referred to for predicting the intraprediction modes according to an exemplary embodiment.

Prediction units (PUs) are shown as examples of the blocks. The PUs aredata units for performing the prediction by each coding unit, in a videoencoding method based on a coding unit according to a tree structure.The video encoding apparatus 10 and the video decoding apparatus 20according to the present embodiment are not limited to the PU having afixed size, but may perform the prediction with respect to PUs ofvarious sizes. The video decoding method and the PU based on the codingunit according to the tree structure will be described later withreference to FIGS. 7 through 19. Hereinafter, exemplary embodiments forpredicting the intra prediction mode of the PU will be described;however, the exemplary embodiments may be applied similarly to variouskinds of blocks.

The video encoding apparatus 10 according to the present embodiment maydetermine whether there is an intra prediction mode that is the same asthe current prediction mode of a current PU 30, from among the intraprediction modes of a left PU 32 and an upper PU 33, to predict theintra prediction mode of the current PU 30 according to the presentembodiment. The MPM flag may be encoded according to the determinationresult.

For example, if the intra prediction modes of the left PU 32 and theupper PU 33 are different from the current intra prediction mode, theMPM flag is encoded to ‘0’, and if at least one of the intra predictionmodes of the left PU 32 and the upper PU 33 is the same as the currentintra prediction mode, the MPM flag may be encoded to ‘1’.

Hereinafter, the intra prediction modes of the left and upper PUs 32 and33 will be referred to as left and upper intra prediction modes,respectively, for convenience of description.

If the left and upper intra prediction modes are different from thecurrent intra prediction mode, the current intra mode informationrepresenting the current intra prediction mode may be encoded.

If there is the intra prediction mode that is the same as the currentintra prediction mode between the left and upper intra prediction modes,two or more different candidate intra prediction modes may be determinedfor predicting the current intra prediction mode. The candidate intraprediction modes may be intra prediction modes that have a higherprobability to be predicted as the current intra prediction mode.

The two candidate intra prediction modes may be the left intraprediction mode and the upper intra prediction mode.

MPM0=min(leftIntraMode,aboveInftraMode);

MPM1=max(leftIntraMode,aboveInftraMode);  <MPM determination equation 1>

In the MPM determination equation 1, MPM0 and MPM1 are respectivelyfirst rank and second rank candidate intra prediction modes. min(A, B)is a function for outputting a smaller value between values of A and B,and max(A, B) is a function for outputting a greater value betweenvalues of A and B.

In the MPM determination equation 1, leftIntraMode and aboveInftraModeare respectively an index of the left intra prediction mode and an indexof the upper intra prediction mode. A smaller index is allocated to theintra prediction mode of higher probability of being generated orpreferably adopted.

That is, according to the MPM determination equation 1, the index of theleft intra prediction mode and the upper intra prediction mode aremapped with the first and second rank candidate intra prediction modesin an increasing order, and thus, the left intra prediction mode and theupper intra prediction mode may be adopted as the candidate intraprediction mode in an order of higher probability or priority.

The above case is also applied to the video decoding apparatus 20. Theleft and upper intra prediction modes are different from the currentintra prediction mode after parsing the MPM flag from the bit stream,the current intra mode information representing the present intraprediction mode is parsed from the bit stream, and when there is theintra prediction mode between the left and upper intra prediction modesthat is the same as the current intra prediction mode, two or moredifferent candidate intra prediction modes for predicting the currentintra prediction mode may be determined.

However, when the left intra prediction mode and the upper intraprediction mode are the same as each other, the plurality of candidateintra prediction modes need to be further determined even if the leftand upper intra prediction modes are adopted as the candidate intraprediction modes.

Hereinafter, assuming that there is the intra prediction mode betweenthe left and upper intra prediction modes, which is the same as thecurrent intra prediction mode, and the left and upper intra predictionmodes are the same as each other, exemplary embodiments for determiningthe plurality of different candidate intra prediction modes will bedescribed.

Example 1

The plurality of candidate intra prediction modes may include differentdefault intra prediction modes. As a default intra prediction modeaccording to the present embodiment, an intra prediction mode that has ahigher probability of being generated, an intra prediction mode havingan improved prediction function, or a mode similar to the left intraprediction mode may be adopted. The prediction mode having the higherprobability of being generated or having the improved predictionfunction may include a DC prediction mode, a planar mode, and a verticaldirection prediction mode (hereinafter, a vertical mode).

In a case where the intra prediction is performed according to theplanar mode from among the intra prediction modes, brightness of pixelsin the PU has a gradation shape and may be predicted to be graduallybrightened or darkened in a predetermined direction.

For example, in a case where the left intra prediction mode is the DCprediction mode or the planar mode, three candidate intra predictionmodes are default intra prediction modes, that is, the DC predictionmode, the planar mode, and the vertical mode.

Example 2

The plurality of candidate intra prediction modes may include the leftintra prediction mode and the default intra prediction modes.

if(leftIntraMode==aboveIntraMode==DC)

aboveIntramode=Planar mode {or 0 if no planar mode}

else

aboveIntraMode=DC  <MPM determination equation 2>

According to the MPM determination equation 2, after determining theleft intra prediction mode and the upper intra prediction mode, thecandidate intra prediction modes may be determined by the MPMdetermination equation 1.

According to the MPM determination equation 2, if the left and upperintra prediction modes are both DC intra prediction modes, the upperintra prediction mode may be changed into the planar mode (or an intraprediction mode having an index “0”). In this case, the candidate intraprediction modes may include the DC prediction mode that is the leftintra prediction mode or the planar mode (or the intra prediction modeof the index “0”) according to the MPM determination equation 1.

Also, according to the MPM determination equation 2, in a case where atleast one of the left intra prediction mode and the upper intraprediction mode is not the DC intra prediction mode, the upper intraprediction mode may be changed into the DC intra prediction mode. Inthis case, the candidate intra prediction modes may include the leftintra prediction mode or the DC intra prediction mode according to theMPM determination equation 1.

Example 3

A plurality of candidate intra prediction modes may be changed intovalues using the left intra prediction mode or modified from the leftintra prediction mode.

For example, in a case where the left intra prediction mode is an intraprediction mode of a predetermined direction, the candidate intraprediction modes include the left intra prediction mode and may includethe intra prediction mode corresponding to an index increasing ordecreasing from the index representing the left intra prediction mode bya predetermined offset.

MPM0=leftIntraMode;

MPM1=leftIntraMode−n;

MPM2=leftIntraMode+n;  <MPM determination equation 3>

According to the MPM determination equation 3, the left intra predictionmode may be adopted as the first rank candidate intra prediction mode,an intra prediction mode having an index that is less than that of theleft intra prediction mode by n may be adopted as the second rankcandidate intra prediction mode, and an intra prediction mode having anindex that is greater than that of the left intra prediction mode by nmay be adopted as the third rank candidate intra prediction mode. Here,n may be, for example, an integer equal to or greater than 1.

Example 4

A plurality of candidate intra prediction modes may be determined byusing a lookup table showing correlations between a value of the leftintra prediction mode and corresponding candidate intra predictionmodes. That is, a plurality of candidate intra prediction modes mappedwith the left intra prediction mode may be selected based on the lookuptable. Since the candidate intra prediction modes are determinedaccording to the left intra prediction mode in the above describedexamples 1, 2, and 3, similar results to those of the lookup tablemapping method according to the left intra prediction mode may bederived.

Example 5

The lookup table of the candidate intra prediction modes may include theleft intra prediction mode as the first rank, and may include the intraprediction modes having higher generation frequencies as the second rankand the like.

The generation frequency or statistical probability of each intraprediction mode that is encoded (decoded) earlier is determined, and theintra prediction modes having higher statistical probabilities may beadopted as the candidate intra prediction modes.

Example 7

If an intra prediction mode of the intra prediction modes of the leftand upper PUs is different from those of the neighboring PUs, thecandidate intra prediction modes may include the left (or upper) intraprediction mode and the detected intra prediction mode of theneighboring PU.

The above examples will now be further described with reference to FIG.4.

FIG. 4 shows examples of PUs that are referred to for predicting theintra prediction mode in the video encoding based on a coding unitaccording to a tree structure.

To predict the intra prediction mode of a current PU 40, a left PU 41and an upper PU 42 may be referred to with top priority. If there are aplurality of PUs adjacent to a left or an upper boundary of the currentPU 40, the intra prediction modes of the left and upper PUs 41 and 42that are adjacent to an upper left sample in the current PU 40 may bereferred to with priority.

If the intra prediction modes of the left PU 41 and the upper PU 42 arethe same as each other, intra prediction modes of neighboring PUs ofpredetermined locations except for the left and upper PUs 41 and 42 fromamong the neighboring PUs adjacent to the current PU 40 may be referredto. For example, the intra prediction modes of an upper left PU 45, anupper right PU 47, and a lower left PU 49 may be referred to. If one ofthe intra prediction modes of the upper left PU 45, the upper right PU47, and the lower left PU 49 is different from the intra predictionmodes of the left and upper PUs 41 and 42, it may be adopted as thecandidate intra prediction mode.

For example, the first rank candidate intra prediction mode may be theintra prediction modes of the left PU 41 and the upper PU 42. It isdetected whether there is an intra prediction mode that is the differentfrom the intra prediction modes of the left and upper PUs 41 and 42,from among the intra prediction modes of the upper left PU 45, the upperright PU 47, and the lower left PU 49 in a predetermined order, and theintra prediction mode that is first detected may be adopted as thesecond rank candidate intra prediction mode.

As another example, if the intra prediction modes of the left and upperPUs 41 and 42 are the same as each other, it is sequentially detected ina predetermined order whether there is an intra prediction mode that isdifferent from the intra prediction modes of the left and upper PUs 41and 42 from among the intra prediction modes of the neighboring PUs 43,44, 45, 47, and 49 except for the left and upper PUs 41 and 42, and theintra prediction mode that is first detected may be adopted as thesecond rank candidate prediction mode.

In more detail, the intra prediction mode of the neighboring PUs iscompared with the intra prediction modes of the left and upper PUs 41and 42 starting from the upper right PU 47, and it may be determined bysearching whether there is a PU having the intra prediction mode that isdifferent from the intra prediction modes of the left and upper PUs 41and 42 among the neighboring PUs 47, 44, and 45 located on an upperportion of the current PU 40. The intra prediction mode that is firstdetected may be adopted as the second rank candidate intra predictionmode.

After searching for the upper left PU 45, if there is no intraprediction mode that is different from the intra prediction modes of theleft and upper PUs 41 and 42, it may be determined by searching whetherthere is a PU having the intra prediction mode that is different fromthe intra prediction modes of the left and upper PUs 41 and 42 startingfrom the lower left PU 49 upward among the neighboring PUs located at aleft side of the current PU 40. The intra prediction mode first detectedmay be adopted as the second rank candidate intra prediction mode.

In the present embodiment, the neighboring PUs located on an upperportion of the current PU starting from the upper right PU 47 aresearched for, and then, the neighboring PUs located at the left side ofthe current PU starting from the lower left PU 49 are searched for;however, the above searching order may vary.

In a case where one of the left and upper intra prediction modes is thesame as the current intra prediction mode and the left intra predictionmode and the upper intra prediction mode are the same as each other,various exemplary embodiments for determining the plurality of differentcandidate intra prediction modes are described above.

As described above, the video encoding apparatus 10 and the videodecoding apparatus 20 of the present embodiment may predict the currentintra prediction mode by using the plurality of candidate intraprediction modes that are different from each other in a case wherethere is at least one of the left and upper intra prediction mode, whichis the same as the current prediction mode, and the left and upper intraprediction modes are different from or the same as each other.

Accordingly, if the intra prediction modes of the neighboring left andupper blocks are the same as each other, the video encoding apparatus 10does not need to encode the information representing a case where thenumber of candidate intra prediction modes is changed, and may encodeonly the MPM flag and the current intra mode information as theinformation relating to the intra prediction mode.

Therefore, the video decoding apparatus 20 according to the presentembodiment parses only the MPM flag and the current intra modeinformation during the parsing process of the information relating tothe intra prediction of the current block, and there is no need todetermine whether the intra prediction modes of the neighboring left andupper blocks are the same as each other. Since there is no need todetermine whether the intra prediction modes of the left and upperblocks are the same as each other, there is no need to restore the intraprediction modes of the left and upper blocks. In addition, since theprocess of restoring the intra prediction mode from the parsed symbolsduring the parsing of the symbols and parsing the symbols again isomitted, the parsing process of the intra prediction mode may beperformed more promptly. As such, efficiency of the decoding processincluding the parsing and restoring of the intra prediction mode may beimproved.

Also, the prediction mode of the intra prediction mode for processingonly one candidate intra prediction mode is omitted, and thus, thedecoding process may be simplified.

FIG. 5 is a flowchart illustrating a video encoding method according toan exemplary embodiment.

In operation S51, the intra prediction mode determined through the intraprediction of the current block from among the video blocks is comparedwith intra prediction modes of the left block and the upper block thatare adjacent to the current block.

In operation S53, an MPM flag representing whether there is the intraprediction mode between the intra prediction modes of the left and upperblocks of the current block, which is the same as the intra predictionmode of the current block is encoded.

In operation S55, if there is the intra prediction mode that is the sameas the intra prediction mode of the current block between the intraprediction modes of the left and upper blocks, a plurality of candidateintra prediction modes, the number of which is fixed, are determinedeven if the intra prediction modes of the left and upper locks aredifferent from or the same as each other.

In operation S57, the current intra mode information of the currentblock, which is determined based on the plurality of candidate intraprediction modes, is encoded.

If the intra prediction modes of the left and upper blocks are the sameas each other in operation S55, the default intra prediction modes maybe determined as the plurality of candidate intra prediction modes basedon the intra prediction mode of the left block.

Also, in a case where the intra prediction modes of the left and upperblocks are the same as each other, the plurality of candidate intraprediction modes may be determined by using the intra prediction mode ofthe left block.

Also, if the intra prediction modes of the left and upper blocks aredifferent from each other, two candidate intra prediction modes fromamong the plurality of candidate intra prediction modes may bedetermined as the intra prediction modes of the left and upper blocks.

In operation 57, if there is the intra prediction mode that is the sameas the intra prediction mode of the current block between the intraprediction modes of the left and upper blocks, index informationrepresenting the candidate intra prediction mode corresponding to theintra prediction block of the current block from among the plurality ofcandidate intra prediction modes may be encoded.

Also, the current intra prediction mode of the current block isdetermined based on the intra prediction mode of the current block andthe plurality of candidate intra prediction modes even when the intraprediction mode of the current block is different from the intraprediction modes of the left and upper blocks in operation S55, andaccordingly, the current intra mode information representing arelationship between the current intra prediction mode and the candidateintra prediction modes may be encoded in operation S57.

FIG. 6 is a flowchart illustrating a video decoding method according toan exemplary embodiment.

In operation S61, the MPM flag of the current block is parsed whileparsing the symbols of the current block from among the encoded blocksfrom the received bit stream.

In operation S63, it is determined whether the plurality of candidateintra prediction modes, the number of which is fixed, are used, topredict the intra prediction mode of the current block based on the MPMflag.

In operation S65, after parsing the block symbols, the intra predictionmode of the current block is restored by using the parsed symbols. In acase where it is determined that the plurality of candidate intraprediction modes are used based on the MPM flag in operation S63, theplurality of candidate intra prediction modes, the number of which isfixed, may be determined to predict the intra prediction mode of thecurrent block based on the intra prediction modes of the left and upperblocks that are adjacent to the current block in operation S65. Theintra prediction mode of the current block may be predicted by using thedetermined plurality of candidate intra prediction modes.

In operation S67, the intra prediction on the current block is performedby using the intra prediction mode predicted in operation S65.

When the plurality of candidate intra prediction modes are determined inoperation S65, if the intra prediction modes of the left and upperblocks are the same as each other, the default intra prediction modesmay be determined as the plurality of candidate intra prediction modesbased on the intra prediction mode of the left block.

Also, if the intra prediction modes of the left and upper blocks are thesame as each other, the plurality of candidate intra prediction modesmay be determined by using the intra prediction mode of the left block.

When the plurality of candidate intra prediction modes are determined inoperation S65, if the intra prediction modes of the left and upperblocks are different from each other, two candidate intra predictionmodes from among the plurality of candidate intra prediction modes maybe determined as the intra prediction modes of the left and upperblocks.

If it is determined that the plurality of intra prediction modes areused to predict the intra prediction mode of the current block based onthe MPM flag in operation S63, index information representing one of theplurality of candidate intra prediction modes may be parsed from the bitstream. In this case, in operation S65, one candidate intra predictionmode selected based on the index information from among the plurality ofcandidate intra prediction modes may be determined as the intraprediction mode of the current block.

Also, in a case where it is determined that the intra prediction mode ofthe current block is different from the intra prediction modes of theleft and upper blocks based on the MPM flag in operation S63, thecurrent intra mode information of the current block may be furtherparsed from the bit stream. In this case, in operation S64, arelationship between the intra prediction mode of the current block andthe plurality of candidate intra prediction modes is interpreted fromthe parsed current intra mode information of the current block, and theintra prediction mode of the block may be determined based on theinterpreted result.

In the video encoding apparatus 10 and the video decoding apparatus 20according to an exemplary embodiment, the blocks divided from the videodata are divided into the coding units of the tree structure, and thePUs are used for performing the intra prediction with respect to thecoding units, as described above. Hereinafter, a method and an apparatusfor encoding a video, and a method and an apparatus for decoding a videobased on a coding unit of a tree structure and a transformation unitwill be described with reference to FIGS. 7 through 19.

FIG. 7 is a block diagram of a video encoding apparatus 100 based on acoding unit according to a tree structure according to an exemplaryembodiment.

The video encoding apparatus 100 for performing video prediction basedon a coding unit of the tree structure according to the presentembodiment includes a maximum coding unit splitter 110, a coding unitdeterminer 120, and an output unit 130. Hereinafter, the term ‘videoencoding apparatus 100’ is used to refer to an apparatus for performingvideo prediction based on a coding unit of the tree structure accordingto the present embodiment, for convenience of description.

The maximum coding unit splitter 110 may split a current picture of animage based on a maximum coding unit. If the current picture is largerthan the maximum coding unit, image data of the current picture may besplit into the at least one maximum coding unit. The maximum coding unitaccording to an exemplary embodiment may be a data unit having a size of32×32, 64×64, 128×128, 256×256, etc., wherein a shape of the data unitis a square having a width and a length in squares of 2. The image datamay be output to the coding unit determiner 120 according to the atleast one maximum coding unit.

A coding unit according to an exemplary embodiment may be characterizedby a maximum size and a depth. The depth denotes the number of times thecoding unit is spatially split from the maximum coding unit, and as thedepth increases, deeper encoding units according to depths may be splitfrom the maximum coding unit to a minimum coding unit. A depth of themaximum coding unit is an uppermost depth and a depth of the minimumcoding unit is a lowermost depth. Since a size of a coding unitcorresponding to each depth decreases as the depth of the maximum codingunit increases, a coding unit corresponding to an upper depth mayinclude a plurality of coding units corresponding to lower depths.

As described above, the image data of the current picture is split intothe maximum coding units according to a maximum size of the coding unit,and each of the maximum coding units may include deeper coding unitsthat are split according to depths. Since the maximum coding unitaccording to an exemplary embodiment is split according to depths, theimage data of a spatial domain included in the maximum coding unit maybe hierarchically classified according to depths.

A maximum depth and a maximum size of a coding unit, which limit thetotal number of times a height and a width of the maximum coding unitmay be hierarchically split, may be predetermined.

The coding unit determiner 120 encodes at least one split regionobtained by splitting a region of the maximum coding unit according todepths, and determines a depth to output finally encoded image dataaccording to the at least one split region. In other words, the codingunit determiner 120 determines a coded depth by encoding the image datain the deeper coding units according to depths, according to the maximumcoding unit of the current picture, and selecting a depth having a leastencoding error. The determined coded depth and the image data for eachmaximum coding unit are output to the output unit 130.

The image data in the maximum coding unit is encoded based on the deepercoding units corresponding to at least one depth equal to or below themaximum depth, and results of encoding the image data are compared basedon each of the deeper coding units. A depth having the least encodingerror may be selected after comparing encoding errors of the deepercoding units. At least one coded depth may be selected for each maximumcoding unit.

The size of the maximum coding unit is split as a coding unit ishierarchically split according to depths, and as the number of codingunits increases. Also, even if coding units correspond to the same depthof one maximum coding unit, it is determined whether to split each ofthe coding units corresponding to the same depth to a lower depth bymeasuring an encoding error of the image data of the each coding unit,separately. Accordingly, even when image data is included in one maximumcoding unit, the image data is split into regions according to thedepths and the encoding errors may differ according to regions in theone maximum coding unit, and thus the coded depths may differ accordingto regions in the image data. Thus, one or more coded depths may bedetermined in one maximum coding unit, and the image data of the maximumcoding unit may be divided according to coding units of at least onecoded depth.

Accordingly, the coding unit determiner 120 may determine coding unitshaving a tree structure included in the maximum coding unit. The ‘codingunits having a tree structure’ according to an exemplary embodimentinclude coding units corresponding to a depth determined to be the codeddepth, from among all deeper coding units included in the maximum codingunit. A coding unit of a coded depth may be hierarchically determinedaccording to depths in the same region of the maximum coding unit, andmay be independently determined in different regions. Similarly, a codeddepth in a current region may be independently determined from a codeddepth in another region.

A maximum depth according to an exemplary embodiment is an index relatedto the number of splitting from a maximum coding unit to a minimumcoding unit. A first maximum depth according to an exemplary embodimentmay denote the total number of splitting from the maximum coding unit tothe minimum coding unit. A second maximum depth according to anexemplary embodiment may denote the total number of depth levels fromthe maximum coding unit to the minimum coding unit. For example, when adepth of the maximum coding unit is 0, a depth of a coding unit, inwhich the maximum coding unit is split once, may be set to 1, and adepth of a coding unit, in which the maximum coding unit is split twice,may be set to 2. Here, if the minimum coding unit is a coding unit inwhich the maximum coding unit is split four times, 5 depth levels ofdepths 0, 1, 2, 3 and 4 exist, and thus the first maximum depth may beset to 4, and the second maximum depth may be set to 5.

Prediction encoding and transformation may be performed according to themaximum coding unit. The prediction encoding and the transformation arealso performed based on the deeper coding units according to a depthequal to or depths less than the maximum depth, according to the maximumcoding unit.

Since the number of deeper coding units increases whenever the maximumcoding unit is split according to depths, encoding including theprediction encoding and the transformation is performed on all of thedeeper coding units generated as the depth increases. For convenience ofdescription, the prediction encoding and the transformation will now bedescribed based on a coding unit of a current depth, in a maximum codingunit.

The video encoding apparatus 100 may variously select a size or a shapeof a data unit for encoding the image data. To encode the image data,operations, such as prediction encoding, transformation, and entropyencoding, are performed, and at this time, the same data unit may beused for all operations or different data units may be used for eachoperation.

For example, the video encoding apparatus 100 may select not only acoding unit for encoding the image data, but also a data unit differentfrom the coding unit to perform the prediction encoding on the imagedata in the coding unit.

To perform prediction encoding in the maximum coding unit, theprediction encoding may be performed based on a coding unitcorresponding to a coded depth, i.e., based on a coding unit that is nolonger split into coding units corresponding to a lower depth.Hereinafter, the coding unit that is no longer split and becomes a basisunit for prediction encoding will now be referred to as a ‘predictionunit’. A partition obtained by splitting the prediction unit may includea prediction unit or a data unit obtained by splitting at least one of aheight and a width of the prediction unit. The partition may be a dataunit obtained by splitting the prediction unit of the coding unit, andthe prediction unit may be a partition having the same size as that ofthe coding unit.

For example, when a coding unit of 2N×2N (where N is a positive integer)is no longer split and becomes a prediction unit of 2N×2N, a size of apartition may be 2N×2N, 2N×N, N×2N, or N×N. Examples of a partition typeinclude symmetrical partitions that are obtained by symmetricallysplitting a height or a width of the prediction unit, partitionsobtained by asymmetrically splitting the height or the width of theprediction unit, such as 1:n or n:1, partitions that are obtained bygeometrically splitting the prediction unit, and partitions havingarbitrary shapes.

A prediction mode of the prediction unit may be at least one of an intramode, an inter mode, and a skip mode. For example, the intra mode or theinter mode may be performed on the partition of 2N×2N, 2N×N, N×2N, orN×N. Also, the skip mode may be performed only on the partition of2N×2N. The encoding is independently performed on one prediction unit ina coding unit, thereby selecting a prediction mode having a leastencoding error.

The video encoding apparatus 100 may also perform the transformation onthe image data in a coding unit based not only on the coding unit forencoding the image data, but also based on a data unit that is differentfrom the coding unit. To perform the transformation in the coding unit,the transformation may be performed based on a data unit having a sizesmaller than or equal to the coding unit. For example, the data unit forthe transformation may include a data unit for an intra mode and a dataunit for an inter mode.

Similarly to the coding unit, the transformation unit in the coding unitmay be recursively split into smaller sized regions, so that thetransformation unit may be determined independently in units of regions.Thus, residual data in the coding unit may be divided according to thetransformation having the tree structure according to transformationdepths.

A transformation depth indicating the number of splitting to reach thetransformation unit by splitting the height and the width of the codingunit may also be set in the transformation unit. For example, in acurrent coding unit of 2N×2N, a transformation depth may be 0 when thesize of a transformation unit is also 2N×2N, may be 1 when the size ofthe transformation unit is thus N×N, and may be 2 when the size of thetransformation unit is thus N/2×N/2. That is, the transformation unitmay be set according to a tree structure.

Encoding information according to coding units corresponding to a codeddepth requires not only information about the coded depth, but alsoabout information related to prediction encoding and transformation.Accordingly, the coding unit determiner 120 not only determines a codeddepth having a least encoding error, but also determines a partitiontype in a prediction unit, a prediction mode according to predictionunits, and a size of a transformation unit for transformation.

Coding units according to a tree structure in a maximum coding unit anda method of determining a prediction unit/partition, and thetransformation unit, according to exemplary embodiments will bedescribed in detail later with reference to FIGS. 7 through 19.

The coding unit determiner 120 may measure an encoding error of deepercoding units according to depths by using Rate-Distortion Optimizationbased on Lagrangian multipliers.

The output unit 130 outputs the image data of the maximum coding unit,which is encoded based on the at least one coded depth determined by thecoding unit determiner 120, and information about the encoding modeaccording to the coded depth, in bitstreams.

The encoded image data may be obtained by encoding residual data of animage.

The information about the encoding mode according to coded depth mayinclude information about the coded depth, the partition type in theprediction unit, the prediction mode, and the size of the transformationunit.

The information about the coded depth may be defined by using splitinformation according to depths, which indicates whether encoding isperformed on coding units of a lower depth instead of a current depth.If the current depth of the current coding unit is the coded depth,image data in the current coding unit is encoded and output, and thusthe split information may be defined not to split the current codingunit to a lower depth. Alternatively, if the current depth of thecurrent coding unit is not the coded depth, the encoding is performed onthe coding unit of the lower depth, and thus the split information maybe defined to split the current coding unit to obtain the coding unitsof the lower depth.

If the current depth is not the coded depth, encoding is performed onthe coding unit that is split into the coding unit of the lower depth.Since at least one coding unit of the lower depth exists in one codingunit of the current depth, the encoding is repeatedly performed on eachcoding unit of the lower depth, and thus the encoding may be recursivelyperformed for the coding units having the same depth.

Since the coding units having a tree structure are determined for onemaximum coding unit, and information about at least one encoding mode isdetermined for a coding unit of a coded depth, information about atleast one encoding mode may be determined for one maximum coding unit.Also, a coded depth of the image data of the maximum coding unit may bedifferent according to locations since the image data is hierarchicallysplit according to depths, and thus information about the coded depthand the encoding mode may be set for the image data.

Accordingly, the output unit 130 may assign encoding information about acorresponding coded depth and an encoding mode to at least one of thecoding unit, the prediction unit, and a minimum unit included in themaximum coding unit.

The minimum unit according to an exemplary embodiment is a rectangulardata unit obtained by splitting the minimum coding unit constituting thelowermost depth by 4. Also, the minimum unit may be a maximum squaredata unit that may be included in all of the coding units, predictionunits, partition units, and transformation units included in the maximumcoding unit.

For example, the encoding information output through the output unit 130may be classified into encoding information according to coding units,and encoding information according to prediction units. The encodinginformation according to the coding units may include the informationabout the prediction mode and about the size of the partitions. Theencoding information according to the prediction units may includeinformation about an estimated direction of an inter mode, about areference image index of the inter mode, about a motion vector, about achroma component of an intra mode, and about an interpolation method ofthe intra mode.

Also, information about a maximum size of the coding unit definedaccording to pictures, slices, or groups of pictures (GOPs), andinformation about a maximum depth may be inserted into a header of abitstream, a sequence parameter set (SPS), or a picture parameter set(PPS).

Also, information about a maximum size and a minimum size of thetransformation unit allowed to the current video may be output via aheader of a bitstream, SPS, or PPS. The output unit 130 may encode andoutput reference information relating to the prediction described withreference to FIGS. 1 through 6, e.g., the prediction information, singledirection prediction information, and slice type information including afourth slice type.

In the video encoding apparatus 100, the deeper coding unit may be acoding unit obtained by dividing a height or a width of a coding unit ofan upper depth, which is one layer above, by two. In other words, whenthe size of the coding unit of the current depth is 2N×2N, the size ofthe coding unit of the lower depth is N×N. Also, the coding unit of thecurrent depth having the size of 2N×2N may include at most 4 codingunits of the lower depth.

Accordingly, the video encoding apparatus 100 may form the coding unitshaving the tree structure by determining coding units having anappropriate (e.g., optimum) shape and an optimum size for each maximumcoding unit, based on the size of the maximum coding unit and themaximum depth determined considering characteristics of the currentpicture. Also, since encoding may be performed on each maximum codingunit by using any one of various prediction modes and transformations,an optimum encoding mode may be determined in consideration ofcharacteristics of the coding unit of various image sizes.

Thus, if an image having a higher resolution or larger data amount isencoded in a related art macroblock, a number of macroblocks per pictureexcessively increases. Accordingly, a number of pieces of compressedinformation generated for each macroblock increases, and thus it isdifficult to transmit the compressed information and data compressionefficiency decreases. However, by using the video encoding apparatus100, image compression efficiency may be increased since a coding unitis adjusted while considering characteristics of an image whileincreasing a maximum size of a coding unit in consideration of a size ofthe image.

The video encoding apparatus 100 of FIG. 7 may perform operations of thevideo encoding apparatus 10 described with reference to FIG. 1.

The coding unit determiner 120 may perform operations of the intraprediction unit 12 of the video encoding apparatus 10. The predictionunit for the intra prediction is determined at every maximum coding unitaccording to the coding units having the tree structure, and the intraprediction may be performed by every prediction unit.

The output unit 130 may perform operations of the symbol encoding unit14 of the video encoding apparatus 10. The MPM flag may be encoded forpredicting the intra prediction mode at every PU. If the intraprediction mode of the current PU is the same as at least one of theintra prediction modes of the left and upper PUs, the plurality ofcandidate intra prediction modes, the number of which is fixed, aredetermined without regard to whether the left intra prediction mode andthe upper intra prediction mode are the same as or different from eachother, and the current intra mode information for the current PU isdetermined and encoded based on the candidate intra prediction modes.

The output unit 130 may determine the number of candidate predictionmodes for every picture. Similarly, the number of candidate intraprediction modes may be determined for every slice, for every maximumcoding unit, for every coding unit, or for every PU. Exemplaryembodiments are not limited thereto, and in an exemplary embodiment, thenumber of candidate intra prediction modes may be determined again forevery predetermined data unit.

The output unit 130 may encode the information representing the numberof the candidate intra prediction modes as a parameter of various dataunit levels such as the PPS, the SPS, the maximum coding unit level, thecoding unit level, and the PU level, according to a level of the dataunit to update the number of the candidate intra prediction modes.However, even if the number of the candidate intra prediction modes isdetermined for every data unit, the information representing the numberof the candidate intra prediction modes may not be always encoded.

FIG. 8 is a block diagram of a video decoding apparatus 200 based on acoding unit according to a tree structure, according to an exemplaryembodiment.

The video decoding apparatus 200 performing video prediction based on acoding unit of the tree structure according to the present embodimentincludes a receiver 210, an image data and encoding informationextractor 220, and an image data decoder 230. Hereinafter, the termvideo decoding apparatus 200′ is used to refer to an apparatus forperforming video prediction based on a coding unit of the tree structureaccording to the present embodiment.

Definitions of various terms, such as a coding unit, a depth, aprediction unit, a transformation unit, and information about variousencoding modes, for various operations of the video decoding apparatus200 are substantially the same as those described with reference to FIG.1 and the video encoding apparatus 100.

The receiver 210 receives and parses a bitstream of an encoded video.The image data and encoding information extractor 220 extracts encodedimage data for each coding unit from the parsed bitstream, wherein thecoding units have a tree structure according to each maximum codingunit, and outputs the extracted image data to the image data decoder230. The image data and encoding information extractor 220 may extractinformation about a maximum size of a coding unit of a current picture,from a header about the current picture, the SPS, or the PPS.

Also, the image data and encoding information extractor 220 extractsinformation about a coded depth and an encoding mode for the codingunits having a tree structure according to each maximum coding unit,from the parsed bitstream. The extracted information about the codeddepth and the encoding mode is output to the image data decoder 230. Inother words, the image data in a bit stream is split into the maximumcoding unit so that the image data decoder 230 decodes the image datafor each maximum coding unit.

The information about the coded depth and the encoding mode according tothe maximum coding unit may be set for information about at least onecoding unit corresponding to the coded depth, and information about anencoding mode may include information about a partition type of acorresponding coding unit according to the coded depth, about aprediction mode, and a size of a transformation unit. Also, splittinginformation according to depths may be extracted as the informationabout the coded depth.

The information about the coded depth and the encoding mode according toeach maximum coding unit extracted by the image data and encodinginformation extractor 220 is information about a coded depth and anencoding mode determined to generate a minimum encoding error when anencoder, such as the video encoding apparatus 100, repeatedly performsencoding for each deeper coding unit according to depths according toeach maximum coding unit. Accordingly, the video decoding apparatus 200may restore an image by decoding the image data according to a codeddepth and an encoding mode that generates the minimum encoding error.

Since encoding information about the coded depth and the encoding modemay be assigned to a predetermined data unit from among a correspondingcoding unit, a prediction unit, and a minimum unit, the image data andencoding information extractor 220 may extract the information about thecoded depth and the encoding mode according to the predetermined dataunits. The predetermined data units to which the same information aboutthe coded depth and the encoding mode is assigned may be inferred to bethe data units included in the same maximum coding unit.

The image data decoder 230 restores the current picture by decoding theimage data in each maximum coding unit based on the information aboutthe coded depth and the encoding mode according to the maximum codingunits. In other words, the image data decoder 230 may decode the encodedimage data based on the extracted information about the partition type,the prediction mode, and the transformation unit for each coding unitfrom among the coding units having the tree structure included in eachmaximum coding unit. A decoding process may include prediction includingintra prediction and motion compensation, and inverse transformation.

The image data decoder 230 may perform intra prediction or motioncompensation according to a partition and a prediction mode of eachcoding unit, based on the information about the partition type and theprediction mode of the prediction unit of the coding unit according tocoded depths.

Also, the image data decoder 230 may perform inverse transformationaccording to each transformation unit in the coding unit, based on theinformation about the size of the transformation unit of the coding unitaccording to coded depths, to perform the inverse transformationaccording to maximum coding units. Through the inverse transformation,pixel values of the coding unit in the spatial domain may be restored.

The image data decoder 230 may determine at least one coded depth of acurrent maximum coding unit by using split information according todepths. If the split information indicates that image data is no longersplit in the current depth, the current depth is a coded depth.Accordingly, the image data decoder 230 may decode encoded data of atleast one coding unit corresponding to each coded depth in the currentmaximum coding unit by using the information about the partition type ofthe prediction unit, the prediction mode, and the size of thetransformation unit for each coding unit corresponding to the codeddepth, and output the image data of the current maximum coding unit.

In other words, data units containing the encoding information includingthe same split information may be gathered by observing the encodinginformation set assigned for the predetermined data unit from among thecoding unit, the prediction unit, and the minimum unit, and the gathereddata units may be considered to be one data unit to be decoded by theimage data decoder 230 in the same encoding mode. The decoding of thecurrent coding unit may be performed by collecting the information aboutthe coding mode for every coding unit determined as above.

Also, the video decoding apparatus 200 of FIG. 8 may perform operationsof the video decoding apparatus 20 described with reference to FIG. 2.

The receiver 210 may perform operations of the parsing unit 22 of thevideo decoding apparatus 20. The image data and encoding informationextractor 220 and the image data decoder 230 may perform operations ofthe intra prediction unit 24 of the video decoding apparatus 20.

The parsing unit 22 may parse the MPM flag for predicting the intraprediction mode from the bitstream for every PU, when the PU for theintra prediction is determined by the coding unit having the treestructure. The current intra mode information may be parsed from thebitstream subsequent to the MPM flag without determining whether theleft intra prediction mode and the upper intra prediction mode are thesame as or different from each other. The image data and encodinginformation extractor 220 may restore the current intra prediction modefrom the parsed information after finishing the parsing of the blocksymbols including the MPM flag and the intra mode information. Thecurrent intra prediction mode may be predicted by using the plurality ofcandidate intra prediction modes, the number of which is fixed. Theimage data decoder 230 may perform the intra prediction of the currentPU by using the restored intra prediction mode and the residual data.

The image data and encoding information extractor 220 may determine thenumber of the candidate intra prediction modes for every picture.

The parsing unit 22 may parse the information representing the number ofthe candidate intra prediction modes, the number of which is fixed, fromthe parameters of various data unit levels such as the PPS of thebitstream, the SPS, the maximum coding unit level, the coding unitlevel, and the PU level. In this case, the image data and encodinginformation extractor 220 may determine the candidate intra predictionmodes by as many as the number represented by the parsed information forevery data unit corresponding to the level from which the information isparsed.

However, the image data and encoding information extractor 220 mayupdate the number of candidate intra prediction modes for every slice,the maximum coding unit, the coding unit, or the PU even when theinformation representing the number of candidate intra prediction modesis not parsed.

The video decoding apparatus 200 may obtain information about at leastone coding unit that generates the minimum encoding error when encodingis recursively performed for each maximum coding unit, and may use theinformation to decode the current picture. In other words, the codingunits having the tree structure determined to be the optimum codingunits in each maximum coding unit may be decoded.

Accordingly, even if image data has higher resolution and a largeramount of data, the image data may be efficiently decoded and restoredby using a size of a coding unit and an encoding mode, which areadaptively determined according to characteristics of the image data, byusing information about an optimum encoding mode received from anencoder.

FIG. 9 is a diagram for describing a concept of coding units accordingto an exemplary embodiment.

A size of a coding unit may be expressed in width×height, and may be,for example, 64×64, 32×32, 16×16, and 8×8. A coding unit of 64×64 may besplit into partitions of 64×64, 64×32, 32×64, or 32×32, and a codingunit of 32×32 may be split into partitions of 32×32, 32×16, 16×32, or16×16, a coding unit of 16×16 may be split into partitions of 16×16,16×8, 8×16, or 8×8, and a coding unit of 8×8 may be split intopartitions of 8×8, 8×4, 4×8, or 4×4.

In video data 310, a resolution is 1920×1080, a maximum size of a codingunit is 64, and a maximum depth is 2. In video data 320, a resolution is1920×1080, a maximum size of a coding unit is 64, and a maximum depth is3. In video data 330, a resolution is 352×288, a maximum size of acoding unit is 16, and a maximum depth is 1. The maximum depth shown inFIG. 9 denotes a total number of splits from a maximum coding unit to aminimum decoding unit.

If a resolution is higher or a data amount is larger, a maximum size ofa coding unit may be larger to not only increase encoding efficiency butalso to accurately reflect characteristics of an image. Accordingly, themaximum size of the coding unit of the video data 310 and 320 having thehigher resolution than the video data 330 may be 64.

Since the maximum depth of the video data 310 is 2, coding units 315 ofthe video data 310 may include a maximum coding unit having a long axissize of 64, and coding units having long axis sizes of 32 and 16 sincedepths are increased by two layers by splitting the maximum coding unittwice. Since the maximum depth of the video data 330 is 1, coding units335 of the video data 330 may include a maximum coding unit having along axis size of 16, and coding units having a long axis size of 8since depths are increased by one layer by splitting the maximum codingunit once.

Since the maximum depth of the video data 320 is 3, coding units 325 ofthe video data 320 may include a maximum coding unit having a long axissize of 64, and coding units having long axis sizes of 32, 16, and 8since the depths are increased by 3 layers by splitting the maximumcoding unit three times. As a depth increases, detailed information maybe expressed more precisely.

FIG. 10 is a block diagram of an image encoder 400 based on coding unitsaccording to an exemplary embodiment.

The image encoder 400 performs operations of the coding unit determiner120 of the video encoding apparatus 100 to encode image data. In otherwords, an intra predictor 410 performs intra prediction on coding unitsin an intra mode, from among a current frame 405, and a motion estimator420 and a motion compensator 425 perform inter estimation and motioncompensation on coding units in an inter mode from among the currentframe 405 by using the current frame 405 and a reference frame 495.

Data output from the intra predictor 410, the motion estimator 420, andthe motion compensator 425 is output as a quantized transformationcoefficient through a transformer 430 and a quantizer 440. The quantizedtransformation coefficient is restored as data in a spatial domainthrough an inverse quantizer 460 and an inverse transformer 470, and therestored data in the spatial domain is output as the reference frame 495after being post-processed through a deblocking unit 480 and a loopfiltering unit 490. The quantized transformation coefficient may beoutput as a bitstream 455 through an entropy encoder 450.

In order for the image encoder 400 to be applied in the video encodingapparatus 100, all elements of the image encoder 400, i.e., the intrapredictor 410, the motion estimator 420, the motion compensator 425, thetransformer 430, the quantizer 440, the entropy encoder 450, the inversequantizer 460, the inverse transformer 470, the deblocking unit 480, andthe loop filtering unit 490 perform operations based on each coding unitfrom among coding units having a tree structure while considering themaximum depth of each maximum coding unit.

Specifically, the intra predictor 410, the motion estimator 420, and themotion compensator 425 determines partitions and a prediction mode ofeach coding unit from among the coding units having a tree structurewhile considering the maximum size and the maximum depth of a currentmaximum coding unit, and the transformer 430 determines the size of thetransformation unit in each coding unit from among the coding unitshaving a tree structure.

In particular, the intra predictor 410 may perform operations of theintra prediction unit 12 of the video decoding apparatus 10. A PU forthe intra prediction is determined by the coding unit having the treestructure for every maximum coding unit, and the intra prediction may beperformed for the PU.

In a case where the current PU and the left/upper PUs are the same aseach other and the left intra prediction mode and the upper intraprediction mode are the same as or different from each other, theplurality of candidate intra prediction modes are determined, and thus,the entropy encoder 450 encodes the MPM flag for every PU, and then, mayencode the current intra mode information based on the candidate intraprediction modes for the current prediction unit.

FIG. 11 is a block diagram of an image decoder 500 based on coding unitsaccording to an exemplary embodiment.

A parser 510 parses encoded image data to be decoded and informationabout encoding required for decoding from a bitstream 505. The encodedimage data is output as inverse quantized data through an entropydecoder 520 and an inverse quantizer 530, and the inverse quantized datais restored to image data in a spatial domain through an inversetransformer 540.

An intra predictor 550 performs intra prediction on coding units in anintra mode with respect to the image data in the spatial domain, and amotion compensator 560 performs motion compensation on coding units inan inter mode by using a reference frame 585.

The image data in the spatial domain, which is passed through the intrapredictor 550 and the motion compensator 560, may be output as arestored frame 595 after being post-processed through a deblocking unit570 and a loop filtering unit 580. Also, the image data that ispost-processed through the deblocking unit 570 and the loop filteringunit 580 may be output as the reference frame 585.

To decode the image data in the image data decoder 230 of the videodecoding apparatus 200, the image decoder 500 may perform operations onparsed symbols after the parser 510.

In order for the image decoder 500 to be applied in the video decodingapparatus 200, all elements of the image decoder 500, i.e., the parser510, the entropy decoder 520, the inverse quantizer 530, the inversetransformer 540, the intra predictor 550, the motion compensator 560,the deblocking unit 570, and the loop filtering unit 580 performoperations based on coding units having a tree structure for eachmaximum coding unit.

Specifically, the intra prediction 550 and the motion compensator 560perform operations based on partitions and a prediction mode for each ofthe coding units having a tree structure, and the inverse transformer540 perform operations based on a size of a transformation unit for eachcoding unit.

In particular, the parser 510 may parse the MPM flag for predicting theintra prediction mode from the bitstream for each PU, in a case wherethe PU for the intra prediction is determined by the coding unit havingthe tree structure. The current intra mode information may be parsedfrom the bit stream subsequent to the MPM flag without determiningwhether the left intra prediction mode and the upper intra predictionmode are the same as or different from each other. The entropy decoder520 finishes the parsing of the block symbols including the MPM flag andthe current intra mode information, and may restore the current intraprediction mode from the parsed information. The intra predictor 550 mayperform the intra prediction of the current PU by using the restoredcurrent intra prediction mode and the residual data.

FIG. 12 is a diagram illustrating deeper coding units and partitionsaccording to depths, according to an exemplary embodiment.

The video encoding apparatus 100 and the video decoding apparatus 200use hierarchical coding units to consider characteristics of an image. Amaximum height, a maximum width, and a maximum depth of coding units maybe adaptively determined according to the characteristics of the image,or may be differently set by a user. Sizes of deeper coding unitsaccording to depths may be determined according to the predeterminedmaximum size of the coding unit.

In a hierarchical structure 600 of coding units, according to anexemplary embodiment, the maximum height and the maximum width of thecoding units are each 64, and the maximum depth is 3. Here, the maximumdepth denotes total splitting from the maximum coding unit to theminimum coding unit. Since a depth increases along a vertical axis ofthe hierarchical structure 600, a height and a width of the deepercoding unit correspond to each split. Also, a prediction unit andpartitions, which are bases for prediction encoding of each deepercoding unit, are shown along a horizontal axis of the hierarchicalstructure 600.

In other words, a coding unit 610 is a maximum coding unit in thehierarchical structure 600, wherein a depth is 0 and a size, i.e., aheight by a width, is 64×64. The depth increases along the verticalaxis, and a coding unit 620 having a size of 32×32 and a depth of 1, acoding unit 630 having a size of 16×16 and a depth of 2, and a codingunit 640 having a size of 8×8 and a depth of 3 exist. The coding unit640 having the size of 8×8 and the depth of 3 is a minimum coding unit.

The prediction unit and the partitions of a coding unit are arrangedalong the horizontal axis according to each depth. In other words, ifthe coding unit 610 having the size of 64×64 and the depth of 0 is aprediction unit, the prediction unit may be split into partitionsincluded in the encoding unit 610, i.e., a partition 610 having a sizeof 64×64, partitions 612 having a size of 64×32, partitions 614 having asize of 32×64, or partitions 616 having the size of 32×32.

Similarly, a prediction unit of the coding unit 620 having the size of32×32 and the depth of 1 may be split into partitions included in thecoding unit 620, i.e., a partition 620 having the size of 32×32,partitions 622 having a size of 32×16, partitions 624 having a size of16×32, and partitions 626 having the size of 16×16.

Similarly, a prediction unit of the coding unit 630 having the size of16×16 and the depth of 2 may be split into partitions included in thecoding unit 630, i.e., a partition 630 having the size of 16×16included, partitions 632 having a size of 16×8, partitions 634 having asize of 8×16, and partitions 636 having the size of 8×8.

Similarly, a prediction unit of the coding unit 640 having the size of8×8 and the depth of 3 may be split into partitions included in thecoding unit 640, i.e., a partition 640 having the size of 8×8,partitions 642 having a size of 8×4, partitions 644 having a size of4×8, and partitions 646 having a size of 4×4.

The coding unit 640 having the size of 8×8 and the depth of 3 is theminimum coding unit and a coding unit of the lowermost depth.

To determine the at least one coded depth of the coding unitsconstituting the maximum coding unit 610, the coding unit determiner 120of the video encoding apparatus 100 performs encoding for coding unitscorresponding to each depth included in the maximum coding unit 610.

A number of deeper coding units according to depths including data inthe same range and the same size increases as the depth increases. Forexample, four coding units corresponding to a depth of 2 are required tocover data that is included in one coding unit corresponding to a depthof 1. Accordingly, to compare encoding results of the same dataaccording to depths, the coding unit corresponding to the depth of 1 andfour coding units corresponding to the depth of 2 are each encoded.

To perform encoding for a current depth from among the depths, a leastencoding error may be selected for the current depth by performingencoding for each prediction unit in the coding units corresponding tothe current depth, along the horizontal axis of the hierarchicalstructure 600. Alternatively, the minimum encoding error may be searchedfor by comparing the least encoding errors according to depths, byperforming encoding for each depth as the depth increases along thevertical axis of the hierarchical structure 600. A depth and a partitionhaving the minimum encoding error in the coding unit 610 may be selectedas the coded depth and a partition type of the coding unit 610.

FIG. 13 is a diagram for describing a relationship between a coding unit710 and transformation units 720 according to an exemplary embodiment.

The video encoding apparatus 100 or 200 encodes or decodes an imageaccording to coding units having sizes smaller than or equal to amaximum coding unit for each maximum coding unit. Sizes oftransformation units for transformation during encoding may be selectedbased on data units that are not larger than a corresponding codingunit.

For example, in the video encoding apparatus 100 or 200, if a size ofthe coding unit 710 is 64×64, transformation may be performed by usingthe transformation units 720 having a size of 32×32.

Also, data of the coding unit 710 having the size of 64×64 may beencoded by performing the transformation on each of the transformationunits having the size of 32×32, 16×16, 8×8, and 4×4, which are smallerthan 64×64, and then a transformation unit having the least coding errormay be selected.

FIG. 14 is a diagram for describing encoding information of coding unitscorresponding to a coded depth according to an exemplary embodiment.

The output unit 130 of the video encoding apparatus 100 may encode andtransmit information 800 about a partition type, information 810 about aprediction mode, and information 820 about a size of a transformationunit for each coding unit corresponding to a coded depth, as informationabout an encoding mode.

The information 800 includes information about a shape of a partitionobtained by splitting a prediction unit of a current coding unit,wherein the partition is a data unit for prediction encoding the currentcoding unit. For example, a current coding unit CU_(—)0 having a size of2N×2N may be split into any one of a partition 802 having a size of2N×2N, a partition 804 having a size of 2N×N, a partition 806 having asize of N×2N, and a partition 808 having a size of N×N. Here, theinformation 800 about a partition type is set to indicate one of thepartition 802 having a size of 2N×2N, the partition 804 having a size of2N×N, the partition 806 having a size of N×2N, and the partition 808having a size of N×N.

The information 810 indicates a prediction mode of each partition. Forexample, the information 810 may indicate a mode of prediction encodingperformed on a partition indicated by the information 800, i.e., anintra mode 812, an inter mode 814, or a skip mode 816.

The information 820 indicates a size of a transformation unit to bebased on when transformation is performed on a current coding unit. Forexample, the transformation unit may be a first intra transformationunit 822, a second intra transformation unit 824, a first intertransformation unit 826, or a second intra transformation unit 828.

The image data and encoding information extractor 220 of the videodecoding apparatus 200 may extract and use the information 800, 810, and820 for decoding according to each deeper coding unit.

FIG. 15 is a diagram of deeper coding units according to depthsaccording to an exemplary embodiment.

Split information may be used to indicate a change in depth. The spiltinformation indicates whether a coding unit of a current depth is splitinto coding units of a lower depth.

A prediction unit 910 for prediction encoding a coding unit CU_(—)0 900having a depth of 0 and a size of 2N_(—)0×2N_(—)0 may include partitionsof a partition type 912 having a size of 2N_(—)0×2N_(—)0, a partitiontype 914 having a size of 2N_(—)0×N_(—)0, a partition type 916 having asize of N_(—)0×2N_(—)0, and a partition type 918 having a size ofN_(—)0×N_(—)0. FIG. 15 only illustrates the partition types 912 through918 which are obtained by symmetrically splitting the prediction unit910, but a partition type is not limited thereto, and the partitions ofthe prediction unit 910 may include, for example, asymmetricalpartitions, partitions having a predetermined shape, and partitionshaving a geometrical shape.

Prediction encoding is repeatedly performed on one partition having asize of 2N_(—)0×2N_(—)0, two partitions having a size of 2N_(—)0×N_(—)0,two partitions having a size of N_(—)0×2N_(—)0, and four partitionshaving a size of N_(—)0×N_(—)0, according to each partition type. Theprediction encoding in an intra mode and an inter mode may be performedon the partitions having the sizes of 2N_(—)0×2N_(—)0, N_(—)0×2N_(—)0,2N_(—)0×N_(—)0, and N_(—)0×N_(—)0. The prediction encoding in a skipmode is performed only on the partition having the size of2N_(—)0×2N_(—)0.

Errors of encoding including the prediction encoding in the partitiontypes 912 through 918 are compared, and the least encoding error isdetermined from among the partition types. If an encoding error issmallest in one of the partition types 912 through 916, the predictionunit 910 may not be split into a lower depth.

If the encoding error is the smallest in the partition type 918, a depthis changed from 0 to 1 to split the partition type 918 in operation 920,and encoding is repeatedly performed on coding units 930 having a depthof 2 and a size of N_(—)0×N_(—)0 to search for a minimum encoding error.

A prediction unit 940 for prediction encoding the coding unit 930 havinga depth of 1 and a size of 2N_(—)1×2N_(—)1 may include partitions of apartition type 942 having a size of 2N_(—)1×2N_(—)1, a partition type944 having a size of 2N_(—)1×N_(—)1, a partition type 946 having a sizeof N_(—)1×2N_(—)1, and a partition type 948 having a size ofN_(—)1×N_(—)1. Here, the size of 2N_(—)1×2N_(—)1 of the partition type942 is the same as the size of N_(—)0×N_(—)0 of the partition type 918.

If an encoding error is the smallest in the partition type 948, a depthis changed from 1 to 2 to split the partition type 948 in operation 950,and encoding is repeatedly performed on coding units 960, which have adepth of 2 and a size of N_(—)2×N_(—)2 to search for a minimum encodingerror.

When a maximum depth is d, a split operation according to each depth maybe performed up to when a depth becomes d−1, and split information maybe encoded as up to when a depth is one of 0 to d−2. In other words,when encoding is performed up to when the depth is d−1 after a codingunit corresponding to a depth of d−2 is split in operation 970, aprediction unit 990 for prediction encoding a coding unit 980 having adepth of d−1 and a size of 2N_(d−1)×2N_(d−1) may include partitions of apartition type 992 having a size of 2N_(d−1)×2N_(d−1), a partition type994 having a size of 2N_(d−1)×N_(d−1), a partition type 996 having asize of N_(d−1)×2N_(d−1), and a partition type 998 having a size ofN_(d−1)×N_(d−1).

Prediction encoding may be repeatedly performed on one partition havinga size of 2N_(d−1)×2N_(d−1), two partitions having a size of2N_(d−1)×N_(d−1), two partitions having a size of N_(d−1)×2N_(d−1), fourpartitions having a size of N_(d−1)×N_(d−1) from among the partitiontypes 992 through 998 to search for a partition type having a minimumencoding error.

Even when the partition type 998 has the minimum encoding error, since amaximum depth is d, a coding unit CU_(d−1) having a depth of d−1 is nolonger split to a lower depth, and a coded depth for the coding unitsconstituting a current maximum coding unit 900 is determined to be d−1and a partition type of the current maximum coding unit 900 may bedetermined to be N_(d−1)×N_(d−1). Also, since the maximum depth is d,split information for the coding unit 980 having the depth d−1 is notset.

A data unit 999 may be a ‘minimum unit’ for the current maximum codingunit. A minimum unit according to an exemplary embodiment may be arectangular data unit obtained by splitting a minimum coding unit 980 by4. By performing the encoding repeatedly, the video encoding apparatus100 may select a depth having the least encoding error by comparingencoding errors according to depths of the coding unit 900 to determinea coded depth, and set a corresponding partition type and a predictionmode as an encoding mode of the coded depth.

As such, the minimum encoding errors according to depths are compared inall of the depths of 1 through d, and a depth having the least encodingerror may be determined as a coded depth. The coded depth, the partitiontype of the prediction unit, and the prediction mode may be encoded andtransmitted as information about an encoding mode. Also, since a codingunit is split from a depth of 0 to a coded depth, only split informationof the coded depth is set to 0, and split information of depthsexcluding the coded depth is set to 1.

The image data and encoding information extractor 220 of the videodecoding apparatus 200 may extract and use the information about thecoded depth and the prediction unit of the coding unit 900 to decode thepartition 912. The video decoding apparatus 200 may determine a depth,in which split information is 0, as a coded depth by using splitinformation according to depths, and use information about an encodingmode of the corresponding depth for decoding.

FIGS. 16 through 18 are diagrams for describing a relationship betweencoding units 1010, prediction units 1060, and transformation units 1070according to an exemplary embodiment.

The coding units 1010 are coding units having a tree structure,corresponding to coded depths determined by the video encoding apparatus100, in a maximum coding unit. The prediction units 1060 are partitionsof prediction units of each of the coding units 1010, and thetransformation units 1070 are transformation units of each of the codingunits 1010.

When a depth of a maximum coding unit is 0 in the coding units 1010,depths of coding units 1012 and 1054 are 1, depths of coding units 1014,1016, 1018, 1028, 1050, and 1052 are 2, depths of coding units 1020,1022, 1024, 1026, 1030, 1032, and 1048 are 3, and depths of coding units1040, 1042, 1044, and 1046 are 4.

In the prediction units 1060, some encoding units 1014, 1016, 1022,1032, 1048, 1050, 1052, and 1054 are obtained by splitting the codingunits in the coding units 1010. In other words, partition types in thecoding units 1014, 1022, 1050, and 1054 have a size of 2N×N, partitiontypes in the coding units 1016, 1048, and 1052 have a size of N×2N, anda partition type of the coding unit 1032 has a size of N×N. Predictionunits and partitions of the coding units 1010 are smaller than or equalto each coding unit.

Transformation or inverse transformation is performed on image data ofthe coding unit 1052 in the transformation units 1070 in a data unitthat is smaller than the coding unit 1052. Also, the coding units 1014,1016, 1022, 1032, 1048, 1050, and 1052 in the transformation units 1070are different from those in the prediction units 1060 in terms of sizesand shapes. In other words, the video encoding and decoding apparatuses100 and 200 may perform intra prediction, motion estimation, motioncompensation, transformation, and inverse transformation individually ona data unit in the same coding unit.

Accordingly, encoding is recursively performed on each of coding unitshaving a hierarchical structure in each region of a maximum coding unitto determine an optimum coding unit, and thus coding units having arecursive tree structure may be obtained. Encoding information mayinclude split information about a coding unit, information about apartition type, information about a prediction mode, and informationabout a size of a transformation unit. Table 1 shows the encodinginformation that may be set by the video encoding and decodingapparatuses 100 and 200.

TABLE 1 Split Information 0 (Encoding on Coding Unit having Size of 2N ×2N and Current Depth of d) Size of Transformation Unit Split SplitPartition Type Information 0 Information 1 symmetrical of of PredictionPartition Asymmetrical Transformation Transformation Split Mode TypePartition Type Unit Unit Information 1 Intra 2N × 2N 2N × nU 2N × 2N N ×N Repeatedly Inter 2N × N 2N × nD (Symmetrical Encode Skip (Only  N × 2NnL × 2N Type) Coding Units 2N × 2N)  N × N nR × 2N N/2 × N/2 havingLower (Asymmetrical Depth of d+ Type)

The output unit 130 of the video encoding apparatus 100 may output theencoding information about the coding units having a tree structure, andthe image data and encoding information extractor 220 of the videodecoding apparatus 200 may extract the encoding information about thecoding units having a tree structure from a received bitstream.

Split information indicates whether a current coding unit is split intocoding units of a lower depth. If split information of a current depth dis 0, a depth, in which a current coding unit is no longer split into alower depth, is a coded depth, and thus information about a partitiontype, prediction mode, and a size of a transformation unit may bedefined for the coded depth. If the current coding unit is further splitaccording to the split information, encoding is independently performedon four split coding units of a lower depth.

A prediction mode may be one of an intra mode, an inter mode, and a skipmode. The intra mode and the inter mode may be defined in all partitiontypes, and the skip mode is defined only in a partition type having asize of 2N×2N.

The information about the partition type may indicate symmetricalpartition types having sizes of 2N×2N, 2N×N, N×2N, and N×N, which areobtained by symmetrically splitting a height or a width of a predictionunit, and asymmetrical partition types having sizes of 2N×nU, 2N×nD,nL×2N, and nR×2N, which are obtained by asymmetrically splitting theheight or width of the prediction unit. The asymmetrical partition typeshaving the sizes of 2N×nU and 2N×nD may be respectively obtained bysplitting the height of the prediction unit in 1:3 and 3:1, and theasymmetrical partition types having the sizes of nL×2N and nR×2N may berespectively obtained by splitting the width of the prediction unit in1:3 and 3:1.

The size of the transformation unit may be set to be two types in theintra mode and two types in the inter mode. In other words, if splitinformation of the transformation unit is 0, the size of thetransformation unit may be 2N×2N, which is the size of the currentcoding unit. If split information of the transformation unit is 1, thetransformation units may be obtained by splitting the current codingunit. Also, if a partition type of the current coding unit having thesize of 2N×2N is a symmetrical partition type, a size of atransformation unit may be N×N, and if the partition type of the currentcoding unit is an asymmetrical partition type, the size of thetransformation unit may be N/2×N/2.

The encoding information about coding units having a tree structure mayinclude at least one of a coding unit corresponding to a coded depth, aprediction unit, and a minimum unit. The coding unit corresponding tothe coded depth may include at least one of a prediction unit and aminimum unit containing the same encoding information.

Accordingly, it is determined whether adjacent data units are includedin the same coding unit corresponding to the coded depth by comparingencoding information of the adjacent data units. Also, a correspondingcoding unit corresponding to a coded depth is determined by usingencoding information of a data unit, and thus a distribution of codeddepths in a maximum coding unit may be determined.

Accordingly, if a current coding unit is predicted based on encodinginformation of adjacent data units, encoding information of data unitsin deeper coding units adjacent to the current coding unit may bedirectly referred to and used.

Alternatively, if a current coding unit is predicted based on encodinginformation of adjacent data units, data units adjacent to the currentcoding unit are searched using encoded information of the data units,and the searched adjacent coding units may be referred for predictingthe current coding unit.

FIG. 19 is a diagram for describing a relationship between a codingunit, a prediction unit or a partition, and a transformation unitaccording to encoding mode information of Table 1.

A maximum coding unit 1300 includes coding units 1302, 1304, 1306, 1312,1314, 1316, and 1318 of coded depths. Here, since the coding unit 1318is a coding unit of a coded depth, split information may be set to 0.Information about a partition type of the coding unit 1318 having a sizeof 2N×2N may be set to be one of a partition type 1322 having a size of2N×2N, a partition type 1324 having a size of 2N×N, a partition type1326 having a size of N×2N, a partition type 1328 having a size of N×N,a partition type 1332 having a size of 2N×nU, a partition type 1334having a size of 2N×nD, a partition type 1336 having a size of nL×2N,and a partition type 1338 having a size of nR×2N.

Split information (or TU size flag) of a transformation unit is a kindof transformation index, and the size of the transformation unitcorresponding to the transformation index may vary depending on theprediction unit type of the coding unit or the partition type.

For example, when the partition type is set to be symmetrical, i.e., thepartition type of sizes 2N×2N (1322), 2N×N (1324), N×2N (1326), or N×N(1328), a transformation unit 1342 having a size of 2N×2N is set ifsplit information (TU size flag) of a transformation unit is 0, and atransformation unit 1344 having a size of N×N is set if a TU size flagis 1.

When the partition type is set to be asymmetrical, i.e., the partitiontype of sizes 2N×nU (1332), 2N×nD (1334), nL×2N (1336), or nR×2N (1338),a transformation unit 1352 having a size of 2N×2N is set if a TU sizeflag is 0, and a transformation unit 1354 having a size of N/2×N/2 isset if a TU size flag is 1.

Referring to FIG. 19, the TU size flag is a flag having a value or 0 or1, but the TU size flag is not limited to 1 bit, and a transformationunit may be hierarchically split in a tree structure while the TU sizeflag increases from 0. The split information of the transformation unitmay be used as an example of the transformation index.

In this case, the size of a transformation unit that has been actuallyused may be expressed by using a TU size flag of a transformation unit,according to an exemplary embodiment, together with a maximum size and aminimum size of the transformation unit. According to an exemplaryembodiment, the video encoding apparatus 100 is capable of encodingmaximum transformation unit size information, minimum transformationunit size information, and a maximum TU size flag. The result ofencoding the maximum transformation unit size information, the minimumtransformation unit size information, and the maximum TU size flag maybe inserted into an SPS. According to an exemplary embodiment, the videodecoding apparatus 200 may decode a video by using the maximumtransformation unit size information, the minimum transformation unitsize information, and the maximum TU size flag.

For example, if the size of a current coding unit is 64×64 and a maximumtransformation unit size is 32×32, the size of a transformation unit maybe 32×32 when a TU size flag is 0, may be 16×16 when the TU size flag is1, and may be 8×8 when the TU size flag is 2.

As another example, if the size of the current coding unit is 32×32 anda minimum transformation unit size is 32×32, the size of thetransformation unit may be 32×32 when the TU size flag is 0. Here, theTU size flag cannot be set to a value other than 0, since the size ofthe transformation unit cannot be less than 32×32.

As another example, if the size of the current coding unit is 64×64 anda maximum TU size flag is 1, the TU size flag may be 0 or 1. Here, theTU size flag cannot be set to a value other than 0 or 1.

Thus, if it is defined that the maximum TU size flag is‘MaxTransformSizeIndex’, a minimum transformation unit size is‘MinTransformSize’, and a transformation unit size is RootTuSize′ whenthe TU size flag is 0, a current minimum transformation unit size‘CurrMinTuSize’ that can be determined in a current coding unit, may bedefined by Equation (1):

CurrMinTuSize=max(MinTransformSize,RootTuSize/(2̂MaxTransformSizeIndex))  (1)

Compared to the current minimum transformation unit size ‘CurrMinTuSize’that can be determined in the current coding unit, a transformation unitsize RootTuSize′ when the TU size flag is 0 may denote a maximumtransformation unit size that can be selected in the system. In Equation(1), ‘RootTuSize/(2̂MaxTransformSizeIndex)’ denotes a transformation unitsize obtained by splitting the maximum transformation unit size‘RootTuSize’, when the TU size flag is 0, a number of timescorresponding to the maximum TU size flag, and ‘MinTransformSize’denotes a minimum transformation size. Thus, a smaller value from among‘RootTuSize/(2̂MaxTransformSizeIndex)’ and ‘MinTransformSize’ may be thecurrent minimum transformation unit size ‘CurrMinTuSize’ that can bedetermined in the current coding unit.

According to an exemplary embodiment, the maximum transformation unitsize RootTuSize may vary according to the type of a prediction mode.

For example, if a current prediction mode is an inter mode, then‘RootTuSize’ may be determined by using Equation (2) below. In Equation(2), ‘MaxTransformSize’ denotes a maximum transformation unit size, and‘PUSize’ denotes a current prediction unit size.

RootTuSize=min(MaxTransformSize,PUSize)  (2)

That is, if the current prediction mode is the inter mode, thetransformation unit size ‘RootTuSize’ when the TU size flag is 0 may bea smaller value from among the maximum transformation unit size and thecurrent prediction unit size.

If a prediction mode of a current partition unit is an intra mode,‘RootTuSize’ may be determined by using Equation (3) below. In Equation(3), ‘PartitionSize’ denotes the size of the current partition unit.

RootTuSize=min(MaxTransformSize,PartitionSize)  (3)

That is, if the current prediction mode is the intra mode, thetransformation unit size ‘RootTuSize’ when the TU size flag is 0 may bea smaller value from among the maximum transformation unit size and thesize of the current partition unit.

However, the current maximum transformation unit size ‘RootTuSize’ thatvaries according to the type of a prediction mode in a partition unit isjust an example and exemplary embodiments are not limited thereto.

According to the video encoding methods based on the coding units havingthe tree structures described with reference to FIGS. 7 through 19, theimage data of the spatial domain is encoded for each coding unit havingthe tree structure, and the decoding is performed for each maximumcoding unit according to the video decoding method based on the codingunits of the tree structure to restore the image data of the spatialdomain, thereby restoring the video that is the picture and the picturesequence. The restored video may be reproduced by a reproducingapparatus, stored in a storage medium, or transferred via a network.

The exemplary embodiments may be written as computer programs and may beimplemented in general-use digital computers that execute the programsusing a computer readable recording medium. Examples of the computerreadable recording medium include magnetic storage media (e.g.,read-only memory (ROM), floppy disks, hard disks, etc.) and opticalrecording media (e.g., compact disc read-only memories (CD-ROMs), ordigital versatile discs (DVDs)).

According to video encoding and video decoding of exemplary embodiments,a constant number of candidate intra prediction modes are assumed whenpredicting the intra prediction mode by using the candidate intraprediction modes, and thus, the MPM flag and the current intra modeinformation may be parsed without considering a case where the number ofcandidate intra prediction modes is changed during the symbol parsingprocess, thereby reducing the complexity of the parsing operation.

The foregoing exemplary embodiments and advantages are merely exemplaryand are not to be construed as limiting. The present teaching can bereadily applied to other types of apparatuses. Also, the description ofthe exemplary embodiments is intended to be illustrative, and not tolimit the scope of the claims, and many alternatives, modifications, andvariations will be apparent to those skilled in the art.

What is claimed is:
 1. An apparatus of decoding a video, comprising: aparser which is configured to obtain, from a bitstream, a modeprediction flag indicating whether intra prediction modes of neighboringblocks are used to determine an intra prediction mode of a currentblock, and, when the mode prediction flag indicates that the intraprediction modes of neighboring blocks are used, parse, from thebitstream, a mode index indicating one among a plurality of candidateintra prediction modes included in a candidate list; a candidate listdeterminer which is configured to determine the candidate list includingintra modes of a left block and an upper block among the neighboringblocks when the intra modes of the left block and the upper block aredifferent from each other; and a intra prediction performer which isconfigured to performing intra prediction on the current block using aprediction mode, indicated by the mode index, among the candidate intraprediction modes included in the candidate list.